-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change tooltip window flags #7613
Conversation
obs-recording-2024-12-12-16-27.mp4This is how the tooltips work now on my computer. Ignore the vst bug, it's been there for a while. |
I'll approve and merge once I get a clarification |
This is not intended. But I don't know why it is happening. Given that I can see the faint outline of the tooltip window in your video before it appears probably means that the window has been created, but not yet filled? I don't know if that would be an issue with the windowing system or with Qt. |
Thanks for the explanation. Your suspects of windowing system and qt seems valid. I believe such glitches are found here and there with qt applications on x11. Btw are you on x11 or Wayland? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's improving the situation, LGTM.
I am on Wayland. I actually don't use/have any VSTs so I'm unsure if this particular issue occurs for me, but other times where |
On sample load, i don't even see a text float |
When loading large samples, it appears for a split second. |
To me it does not look like it is really improving the situation. It now just seems to show the message box that asks the user to wait until the action is completed much too late. It would be better to find out what's causing the current behavior. To me it looks like there's some code that wants to show the message and which start doing so but then something long running is taking over the GUI main thread? |
@regulus79 how much sense would it make to replace this |
@Rossmaxx, a I have checked Can someone please check if it gets better with the following adjustment in
I don't any plugin that takes as much time as the one used by @Rossmaxx in the video. |
Or nvm, that regression caught in my video might be the one from #7554, fixed by #7624. I do have to test now again to confirm. If it's so, there's nothing to do, I'll try @michaelgregorius' suggestion too, just to be sure. The plug-ins i use are 4front e piano and dsk grand piano (IIRC, grabbed them from plugins4free) |
I have just created #7626 which reports other problems with |
@michaelgregorius Although this PR does not fix the other issues with |
This is what I was telling. Though I wasn't descriptive with it. |
I tested this, and it does appear to fix the TextFloat being black at the start. I have now added Edit: I'm not actually sure it fully fixed the issue; now it feels like the TextFloats appear later than they usually do. It's hard to tell. |
src/gui/widgets/TextFloat.cpp
Outdated
@@ -124,6 +125,8 @@ TextFloat * TextFloat::displayMessage(const QString & title, | |||
QTimer::singleShot(timeout, tf, SLOT(close())); | |||
} | |||
|
|||
QCoreApplication::processEvents(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO this is the wrong place to fix the problem. Instead the problem(s) should be fixed in the places where long running operations are performed in the GUI main thread, e.g. in the VST loading code, etc.
The TextFloat
as is works perfectly okay and you would see similar problems with other widgets if they are about to be shown before something that blocks the GUI main thread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
TextFloat
as is works perfectly okay and you would see similar problems with other widgets if they are about to be shown before something that blocks the GUI main thread.
Then why can the problem be still observed when the TextFloat
is shown without any blocking operations? If you switch workspaces while displaying a TextFloat
, it will be drawn on top of the workspace.
Example: Holding down on a clip while switching workspaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the UI thread blocked/not running when not in view? Maybe that's why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sakertooth, I think we might be talking about different problems.
I am talking about the "garbage" that is sometimes shown in the TextFloat
window, like for example shown in the first screenshot in this comment: #7145 (comment)
This seems to caused by the following chain of events:
- Code instructs to show the
TextFloat
with a certain content/message. An event is put into the GUI event loop to show and paint the widget. - For some reason the
TextFloat
window is already shown but not painted yet, i.e. it shows garbage. - A long running operation runs in the main thread, e.g. the loading of a VST plugin, and it blocks the processing of further events. This results in the garbage being visible for a long time.
- The long running operation completes and the paint event for the
TextFloat
is processed, i.e. it is now painted correctly. However, because the long running operation took so long it might even be scheduled for closing again which results in that the users have only seem garbage during that time.
By calling QCoreApplication::processEvents
at the correct place before the long operation the chain changes as follows:
- Code instructs to show the
TextFloat
with a certain content/message. An event is put into the GUI event loop to paint the widget. - The code calls
QCoreApplication::processEvents
before the long running operation. This results in theTextFloat
being shown and painted correctly within milliseconds. For the users it is now shown correctly. - The long running operation runs in the main thread. It is still blocking the main thread from processing further events on time but the
TextFloat
is shown correctly during that time.
My argument is that calling QCoreApplication::processEvents
in TextFloat
is the wrong place because it must be called close to the code that "knows" that it is about to execute a long running operation on the GUI main thread, e.g. in the VST plugin code. The reason is that the problematic chain that's described above would also apply for any other widget to be shown before the long running operation. So if we wanted to show a push button is would likely also only contain garbage. However, we would never get the idea to extend the QPushButton
with some obscure call to QCoreApplication::processEvents
because it might be shown in such a long running context.
It's been some time since I've looked at this. IMO, it would be better to merge the tooltip fix and get done rn and do a follow up for the process events and threading fix. I'm telling this because even without the process event fix, the textfloat seems to "bleed out into the desktop" which does get fixed without the other stuff. @michaelgregorius what do you think? |
@Rossmaxx, do you mean to only leave the following line?
And then to put the calls to That would be okay for me. But the call to |
…splayMessage()" This reverts commit b5f5379.
I have removed the call to |
Partially addresses #7145.
This PR changes the window flags of
TextFloat
s (the tooltip things which appear when loading samples/vst/etc) so that they do not stay on top of other windows.